package com.hkd.common.api.enums;

/**
 * 积分变动来源
 *
 * @author HKD
 * @date 2022/9/17 20:22
 */
public enum PointSource {
    ORDER(1),
    LOGIN(2),
    ACTIVITY(3);

    private Integer code;

    PointSource(Integer code) {
        this.code = code;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public static PointSource search(Integer code) {
        PointSource[] values = values();
        for (PointSource value : values) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}
